import { ResponseSignUpDto, ResponseUserLoginDto, SignUpForm } from '@/types/apiType';

import request from '../utils/request';
import { RequestConfig } from '../utils/request/type';

/**
 * @description
 * @tags 报名接口
 * @summary 任务报名
 * @request post:/api/taskSignup
 */
export const apiTaskSignupByPost = (params: SignUpForm, config?: RequestConfig) =>
  request.post<ResponseUserLoginDto>(`/api/taskSignup`, params, config).then((res) => res?.result);

/**
 * @description
 * @tags 报名接口
 * @summary 报名查询
 * @request get:/api/taskSignup/query
 */
export const apiTaskSignupQueryByGet = (
  params: { activityId: number; goodsId: number; taskId: number },
  config?: RequestConfig
) =>
  request
    .get<ResponseSignUpDto>(`/api/taskSignup/query`, params, config)
    .then((res) => res?.result);
